package com.project.module.exception;


import com.project.module.utill.ResultBean;
import com.project.module.utill.ResultBeanUtil;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class CommonExceptionHandler {


    /**处理异常的handler
     * @param CommonException
     * @return
     */
    @ExceptionHandler(value = CommonException.class)
    @ResponseBody
    public ResultBean handel(CommonException CommonException){
        return ResultBeanUtil.failed(CommonException.getMessage());
    }



}
